import numpy as np
import physo
z = np.random.uniform(-10, 10, 50)
v = np.random.uniform(-10, 10, 50)
X = np.stack((z, v), axis=0)
y = 1.234*9.807*z + 1.234*v**2
# set 1
# set 1. Symbolic regression with default hyperparameters.
expression, logs = physo.SR(X, y,
X_units = [ [1, 0, 0] , [1, -1, 0] ],
y_units = [2, -2, 1],
fixed_consts = [ 1. ],
fixed_consts_units = [ [0,0,0] ],
free_consts_units = [ [0, 0, 1] , [1, -2, 0] ],
)
# set 2 Hyperparameters configurations.
expression, logs = physo.SR(X, y,
X_units = [ [1, 0, 0] , [1, -1, 0] ],
y_units = [2, -2, 1],
fixed_consts = [ 1. ],
fixed_consts_units = [ [0,0,0] ],
free_consts_units = [ [0, 0, 1] , [1, -2, 0] ],
run_config = physo.config.config1.config1
)
# set 3. Selectable symbolic operations.
expression, logs = physo.SR(X, y,
X_names = [ "z" , "v" ],
X_units = [ [1, 0, 0] , [1, -1, 0] ],
y_name = "E",
y_units = [2, -2, 1],
fixed_consts = [ 1. ],
fixed_consts_units = [ [0,0,0] ],
free_consts_names = [ "m" , "g" ],
free_consts_units = [ [0, 0, 1] , [1, -2, 0] ],
op_names = ["mul", "add", "sub", "div", "inv", "n2", "sqrt", "neg", "exp", "log", "sin", "cos"]
)
SR task started...
100%|██████████| 1000/1000 [00:00<00:00, 99707.70it/s] 100%|██████████| 1000/1000 [00:00<00:00, 121658.66it/s]
=========== Epoch 00000 ===========
-> Time 135.42 s
Overall best at R=0.537882
-> Raw expression :
2
c₀₀⋅x₀₁
Best of epoch at R=0.537882
-> Raw expression :
2
c₀₀⋅x₀₁
100%|██████████| 1000/1000 [00:00<00:00, 2729.74it/s] 100%|██████████| 1000/1000 [00:00<00:00, 66274.34it/s]
=========== Epoch 00001 ===========
-> Time 84.00 s
Overall best at R=0.537882
-> Raw expression :
2
c₀₀⋅x₀₁
Best of epoch at R=0.537882
-> Raw expression :
1
────────────────────────────── + 1.0
cos(1.0) 2
- ℯ - 1.0 - 1.0 + 1.0
────────────────────────────────────
⎛ 1 ⎞
⎜────────⎟
⎜⎛ c₀₀ ⎞⎟
⎜⎜──────⎟⎟
⎜⎜ 2⎟⎟
⎜⎜⎛ 1 ⎞ ⎟⎟
⎜⎜⎜───⎟ ⎟⎟
⎝⎝⎝x₀₁⎠ ⎠⎠
100%|██████████| 1000/1000 [00:00<00:00, 3519.95it/s] 100%|██████████| 1000/1000 [00:00<00:00, 38586.05it/s]
=========== Epoch 00002 ===========
-> Time 27.64 s
Overall best at R=0.537882
-> Raw expression :
2
c₀₀⋅x₀₁
Best of epoch at R=0.537882
-> Raw expression :
⎛ 0.5⎞
⎜⎛ 0.5 ⎞ ⎟
⎜⎜⎛ ⎛1.0⎞⎞ ⎟ ⎟
⎜⎜⎜log⎜───⎟⎟ ⎟ ⎟
2 ⎜⎜⎜ ⎝1.0⎠⎟ ⎟ ⎟
c₀₀⋅x₀₁ ⋅sin⎜⎜⎜────────⎟ + 1.0⎟ ⎟
⎜⎜⎜ 1.0 ⎟ ⎟ ⎟
⎝⎝⎝ ℯ ⎠ ⎠ ⎠
100%|██████████| 1000/1000 [00:00<00:00, 3211.26it/s] 100%|██████████| 1000/1000 [00:00<00:00, 77247.44it/s]
=========== Epoch 00003 ===========
-> Time 27.45 s
Overall best at R=0.577732
-> Raw expression :
c₀₀⋅c₀₁
────────────────────
1 1
- ──────────── + ───
-3⋅x₀₀ + x₀₀ x₀₀
Best of epoch at R=0.577732
-> Raw expression :
c₀₀⋅c₀₁
────────────────────
1 1
- ──────────── + ───
-3⋅x₀₀ + x₀₀ x₀₀
100%|██████████| 1000/1000 [00:00<00:00, 14587.11it/s] 100%|██████████| 1000/1000 [00:00<00:00, 106292.55it/s]
=========== Epoch 00004 ===========
-> Time 5.23 s
Overall best at R=0.577732
-> Raw expression :
c₀₀⋅c₀₁
────────────────────
1 1
- ──────────── + ───
-3⋅x₀₀ + x₀₀ x₀₀
Best of epoch at R=0.537882
-> Raw expression :
0.5
⎛ 2⎞
⎜ ⎛ 2 ⎛ ⎛ c₀₁⎞ ⎞⎞ ⎟
⎜-⎜c₀₀⋅x₀₁ ⋅log⎜cos⎜--1.0 + ───⎟⋅1.0⎟⎟ ⎟
⎝ ⎝ ⎝ ⎝ c₀₁⎠ ⎠⎠ ⎠
100%|██████████| 1000/1000 [00:00<00:00, 2535.67it/s] 100%|██████████| 1000/1000 [00:00<00:00, 31950.52it/s]
=========== Epoch 00005 ===========
-> Time 12.38 s
Overall best at R=0.577732
-> Raw expression :
c₀₀⋅c₀₁
────────────────────
1 1
- ──────────── + ───
-3⋅x₀₀ + x₀₀ x₀₀
Best of epoch at R=0.577732
-> Raw expression :
⎛ 2⎞
- sin⎝(1.0⋅1.0) ⎠ + cos(-1.0) + 1.0
c₀₀⋅c₀₁⋅x₀₀⋅ℯ
100%|██████████| 1000/1000 [00:00<00:00, 2894.29it/s] 100%|██████████| 1000/1000 [00:00<00:00, 83921.33it/s]
=========== Epoch 00006 ===========
-> Time 5.27 s
Overall best at R=0.577732
-> Raw expression :
c₀₀⋅c₀₁
────────────────────
1 1
- ──────────── + ───
-3⋅x₀₀ + x₀₀ x₀₀
Best of epoch at R=0.577732
-> Raw expression :
c₀₀
─────────────────────────────
⎛ 1 ⎞
⎜───────────────────────────⎟
⎜ 0.5 1 ⎟
⎜x₀₀⋅1.0⋅c₀₀ ⋅────────────⎟
⎜ 0.5⎟
⎜ ⎛ c₀₀ ⎞ ⎟
⎜ ⎜───────⎟ ⎟
⎝ ⎝c₀₁⋅c₀₁⎠ ⎠
100%|██████████| 1000/1000 [00:00<00:00, 4856.42it/s] 100%|██████████| 1000/1000 [00:00<00:00, 76647.49it/s]
=========== Epoch 00007 ===========
-> Time 10.62 s
Overall best at R=0.577732
-> Raw expression :
c₀₀⋅c₀₁
────────────────────
1 1
- ──────────── + ───
-3⋅x₀₀ + x₀₀ x₀₀
Best of epoch at R=0.577732
-> Raw expression :
⎛ 1 c₀₀⎞
-cos⎜─── + ───⎟
⎝1.0 c₀₀⎠
c₀₀⋅────────────────
c₀₀
c₀₀⋅c₀₁⋅x₀₀⋅ℯ
─────────────────────────────────
1.0
100%|██████████| 1000/1000 [00:00<00:00, 1528.64it/s] 100%|██████████| 1000/1000 [00:00<00:00, 67376.21it/s]
=========== Epoch 00008 ===========
-> Time 6.40 s
Overall best at R=0.577732
-> Raw expression :
c₀₀⋅c₀₁
────────────────────
1 1
- ──────────── + ───
-3⋅x₀₀ + x₀₀ x₀₀
Best of epoch at R=0.577732
-> Raw expression :
-1.0
c₀₀⋅x₀₀⋅─────────
⎛ 0.5⎞
⎜ 1.0 ⎟
⎜───────⎟
⎝c₀₁⋅1.0⎠
100%|██████████| 1000/1000 [00:01<00:00, 922.12it/s] 100%|██████████| 1000/1000 [00:00<00:00, 55751.60it/s]
=========== Epoch 00009 ===========
-> Time 9.52 s
Overall best at R=1.000000
-> Raw expression :
1
c₀₀⋅- -c₀₁⋅-x₀₀ + ────────────
⎛ -c₀₀ ⎞
⎜──────────⎟
⎜ 2⎟
⎝(c₀₀⋅x₀₁) ⎠
Best of epoch at R=1.000000
-> Raw expression :
1
c₀₀⋅- -c₀₁⋅-x₀₀ + ────────────
⎛ -c₀₀ ⎞
⎜──────────⎟
⎜ 2⎟
⎝(c₀₀⋅x₀₁) ⎠
100%|██████████| 1000/1000 [00:02<00:00, 410.96it/s] 100%|██████████| 1000/1000 [00:00<00:00, 45812.85it/s]
=========== Epoch 00010 ===========
-> Time 8.92 s
Overall best at R=1.000000
-> Raw expression :
c₀₀ x₀₀
────── + ─────────────────────────
2 ⎛ -1 ⎞
⎛-1 ⎞ ⎜───────────────────────⎟
⎜───⎟ ⎜ ⎛ ⎛ 2⎞⎞⎟
⎝x₀₁⎠ ⎝c₀₀⋅c₀₁⋅log⎝cos⎝-1.0 ⎠⎠⎠
Best of epoch at R=1.000000
-> Raw expression :
c₀₀ x₀₀
────── + ─────────────────────────
2 ⎛ -1 ⎞
⎛-1 ⎞ ⎜───────────────────────⎟
⎜───⎟ ⎜ ⎛ ⎛ 2⎞⎞⎟
⎝x₀₁⎠ ⎝c₀₀⋅c₀₁⋅log⎝cos⎝-1.0 ⎠⎠⎠
100%|██████████| 1000/1000 [00:02<00:00, 424.17it/s] 100%|██████████| 1000/1000 [00:00<00:00, 30714.90it/s]
=========== Epoch 00011 ===========
-> Time 9.20 s
Overall best at R=1.000000
-> Raw expression :
c₀₀ x₀₀
────── + ─────────────────────────
2 ⎛ -1 ⎞
⎛-1 ⎞ ⎜───────────────────────⎟
⎜───⎟ ⎜ ⎛ ⎛ 2⎞⎞⎟
⎝x₀₁⎠ ⎝c₀₀⋅c₀₁⋅log⎝cos⎝-1.0 ⎠⎠⎠
Best of epoch at R=0.577732
-> Raw expression :
0.5⎛ 1.0⎞
c₀₀⋅c₀₁⋅x₀₀⋅cos ⎝-1.0 + ℯ ⎠
100%|██████████| 1000/1000 [00:01<00:00, 658.20it/s] 100%|██████████| 1000/1000 [00:00<00:00, 41713.20it/s]
=========== Epoch 00012 ===========
-> Time 6.84 s
Overall best at R=1.000000
-> Raw expression :
c₀₀ x₀₀
────── + ─────────────────────────
2 ⎛ -1 ⎞
⎛-1 ⎞ ⎜───────────────────────⎟
⎜───⎟ ⎜ ⎛ ⎛ 2⎞⎞⎟
⎝x₀₁⎠ ⎝c₀₀⋅c₀₁⋅log⎝cos⎝-1.0 ⎠⎠⎠
Best of epoch at R=0.577732
-> Raw expression :
⎛ 2⎞
⎜⎛ 1 ⎞ ⎟ 1
sin⎜⎜────⎟ ⎟⋅c₀₀⋅c₀₁⋅1.0⋅─────
⎝⎝-1.0⎠ ⎠ ⎛ 1 ⎞
⎜───⎟
⎝x₀₀⎠
100%|██████████| 1000/1000 [00:02<00:00, 462.46it/s] 100%|██████████| 1000/1000 [00:00<00:00, 35416.49it/s]
=========== Epoch 00013 ===========
-> Time 18.55 s
Overall best at R=1.000000
-> Raw expression :
-x₀₁
x₀₁⋅─────
⎛-1 ⎞
⎜───⎟
⎝c₀₀⎠
-c₀₁⋅1.0⋅-c₀₀⋅x₀₀ + ─────────
-1.0
Best of epoch at R=1.000000
-> Raw expression :
-x₀₁
x₀₁⋅─────
⎛-1 ⎞
⎜───⎟
⎝c₀₀⎠
-c₀₁⋅1.0⋅-c₀₀⋅x₀₀ + ─────────
-1.0
100%|██████████| 1000/1000 [00:02<00:00, 367.57it/s] 100%|██████████| 1000/1000 [00:00<00:00, 27601.19it/s]
=========== Epoch 00014 ===========
-> Time 8.60 s
Overall best at R=1.000000
-> Raw expression :
-x₀₁
x₀₁⋅─────
⎛-1 ⎞
⎜───⎟
⎝c₀₀⎠
-c₀₁⋅1.0⋅-c₀₀⋅x₀₀ + ─────────
-1.0
Best of epoch at R=0.577732
-> Raw expression :
c₀₀⋅-c₀₁⋅x₀₀
────────────
⎛-1 ⎞
sin⎜───⋅x₀₁⎟
⎝x₀₁ ⎠
SR task started...
100%|██████████| 10000/10000 [00:02<00:00, 4326.69it/s] 100%|██████████| 10000/10000 [00:00<00:00, 118760.94it/s] /rds/project/jmmh2/rds-jmmh2-projects/olink_proteomics/scallop/PhySO/physo/learn/monitoring.py:640: UserWarning: Creating legend with loc="best" can be slow with large amounts of data. self.fig.savefig(self.save_path)
=========== Epoch 00000 ===========
-> Time 52.34 s
Overall best at R=0.577732
-> Raw expression :
⎛ 2⎞
⎜⎛ 1 ⎞ ⎟
cos⎜⎜──────────────⎟ ⎟
⎜⎜ 1 ⎟ ⎟
⎜⎜-1.0⋅1.0 + ───⎟ ⎟
⎝⎝ 1.0⎠ ⎠
c₀₀⋅c₀₁⋅x₀₀⋅ℯ
Best of epoch at R=0.577732
-> Raw expression :
⎛ 2⎞
⎜⎛ 1 ⎞ ⎟
cos⎜⎜──────────────⎟ ⎟
⎜⎜ 1 ⎟ ⎟
⎜⎜-1.0⋅1.0 + ───⎟ ⎟
⎝⎝ 1.0⎠ ⎠
c₀₀⋅c₀₁⋅x₀₀⋅ℯ
100%|██████████| 10000/10000 [00:03<00:00, 2659.08it/s] 100%|██████████| 10000/10000 [00:00<00:00, 106917.09it/s] /rds/project/jmmh2/rds-jmmh2-projects/olink_proteomics/scallop/PhySO/physo/learn/monitoring.py:640: UserWarning: Creating legend with loc="best" can be slow with large amounts of data. self.fig.savefig(self.save_path)
=========== Epoch 00001 ===========
-> Time 46.78 s
Overall best at R=1.000000
-> Raw expression :
⎛ 0.5 ⎞
⎜ ⎛ 1.0 ⎞ 2⎟
c₀₀⋅⎝c₀₁⋅x₀₀⋅⎝-1.0 - -ℯ ⋅1.0⎠ - x₀₁ ⎠
Best of epoch at R=1.000000
-> Raw expression :
⎛ 0.5 ⎞
⎜ ⎛ 1.0 ⎞ 2⎟
c₀₀⋅⎝c₀₁⋅x₀₀⋅⎝-1.0 - -ℯ ⋅1.0⎠ - x₀₁ ⎠
100%|██████████| 10000/10000 [00:04<00:00, 2474.42it/s] 100%|██████████| 10000/10000 [00:00<00:00, 16627.34it/s] /rds/project/jmmh2/rds-jmmh2-projects/olink_proteomics/scallop/PhySO/physo/learn/monitoring.py:640: UserWarning: Creating legend with loc="best" can be slow with large amounts of data. self.fig.savefig(self.save_path)
=========== Epoch 00002 ===========
-> Time 40.85 s
Overall best at R=1.000000
-> Raw expression :
⎛ 0.5 ⎞
⎜ ⎛ 1.0 ⎞ 2⎟
c₀₀⋅⎝c₀₁⋅x₀₀⋅⎝-1.0 - -ℯ ⋅1.0⎠ - x₀₁ ⎠
Best of epoch at R=1.000000
-> Raw expression :
⎛ ⎛c₀₀⎞ 1 ⎞
⎜c₀₀ + c₀₀⋅1.0⋅c₀₁⋅cos⎜───⎟⋅───⎟⋅(-c₀₁⋅x₀₀ + x₀₁⋅x₀₁)
⎝ ⎝c₀₀⎠ c₀₁⎠
100%|██████████| 10000/10000 [00:05<00:00, 1728.43it/s] 100%|██████████| 10000/10000 [00:00<00:00, 16159.06it/s] /rds/project/jmmh2/rds-jmmh2-projects/olink_proteomics/scallop/PhySO/physo/learn/monitoring.py:640: UserWarning: Creating legend with loc="best" can be slow with large amounts of data. self.fig.savefig(self.save_path)
=========== Epoch 00003 ===========
-> Time 53.69 s
Overall best at R=1.000000
-> Raw expression :
⎛ 0.5⎞
⎜⎛ ⎛ 2⎞ ⎞ ⎟
⎜⎜ ⎜⎛ 1.0⎞ ⎟ ⎟ ⎟
c₀₁⋅x₀₀ + x₀₁⋅-x₀₁⋅log⎝⎝sin⎝⎝ℯ ⎠ ⎠⋅1.0⎠ ⎠
─────────────────────────────────────────────
⎛ 1 ⎞
⎜───⎟
⎝c₀₀⎠
Best of epoch at R=1.000000
-> Raw expression :
⎛ 0.5⎞
⎜⎛ ⎛ 2⎞ ⎞ ⎟
⎜⎜ ⎜⎛ 1.0⎞ ⎟ ⎟ ⎟
c₀₁⋅x₀₀ + x₀₁⋅-x₀₁⋅log⎝⎝sin⎝⎝ℯ ⎠ ⎠⋅1.0⎠ ⎠
─────────────────────────────────────────────
⎛ 1 ⎞
⎜───⎟
⎝c₀₀⎠
100%|██████████| 10000/10000 [00:08<00:00, 1148.65it/s] 100%|██████████| 10000/10000 [00:00<00:00, 80080.19it/s] /rds/project/jmmh2/rds-jmmh2-projects/olink_proteomics/scallop/PhySO/physo/learn/monitoring.py:640: UserWarning: Creating legend with loc="best" can be slow with large amounts of data. self.fig.savefig(self.save_path)
=========== Epoch 00004 ===========
-> Time 45.44 s
Overall best at R=1.000000
-> Raw expression :
⎛ c₀₁⋅x₀₀ 2⎞
c₀₀⋅⎜─────────────── - x₀₁ ⎟
⎜ 2 1 ⎟
⎜ 1.0 + ───⋅1.0 ⎟
⎜ 1.0 ⎟
⎝ℯ ⎠
Best of epoch at R=1.000000
-> Raw expression :
⎛ c₀₁⋅x₀₀ 2⎞
c₀₀⋅⎜─────────────── - x₀₁ ⎟
⎜ 2 1 ⎟
⎜ 1.0 + ───⋅1.0 ⎟
⎜ 1.0 ⎟
⎝ℯ ⎠
100%|██████████| 10000/10000 [00:12<00:00, 822.84it/s] 100%|██████████| 10000/10000 [00:00<00:00, 69391.22it/s] /rds/project/jmmh2/rds-jmmh2-projects/olink_proteomics/scallop/PhySO/physo/learn/monitoring.py:640: UserWarning: Creating legend with loc="best" can be slow with large amounts of data. self.fig.savefig(self.save_path)
=========== Epoch 00005 ===========
-> Time 47.69 s
Overall best at R=1.000000
-> Raw expression :
⎛ c₀₁⋅x₀₀ 2⎞
c₀₀⋅⎜─────────────── - x₀₁ ⎟
⎜ 2 1 ⎟
⎜ 1.0 + ───⋅1.0 ⎟
⎜ 1.0 ⎟
⎝ℯ ⎠
Best of epoch at R=1.000000
-> Raw expression :
1 ⎛ 2⎞
c₀₀⋅-1.0⋅1.0⋅─────────⋅⎝-c₀₁⋅x₀₀ + 1.0⋅x₀₁ ⎠
⎛c₀₀⎞
sin⎜───⎟
⎝c₀₀⎠
ℯ
100%|██████████| 10000/10000 [00:16<00:00, 621.91it/s] 100%|██████████| 10000/10000 [00:00<00:00, 53617.36it/s] /rds/project/jmmh2/rds-jmmh2-projects/olink_proteomics/scallop/PhySO/physo/learn/monitoring.py:640: UserWarning: Creating legend with loc="best" can be slow with large amounts of data. self.fig.savefig(self.save_path)
=========== Epoch 00006 ===========
-> Time 51.07 s
Overall best at R=1.000000
-> Raw expression :
-c₀₀
──────────────── + c₀₀⋅x₀₁⋅x₀₁
⎛ 1 ⎞
⎜──────────────⎟
⎜⎛ 1.0 ⎞⎟
⎜⎜- -c₀₁⋅ℯ ⎟⎟
⎜⎜────────────⎟⎟
⎜⎜ ⎛ 1 ⎞ ⎟⎟
⎜⎜ ⎜───⎟ ⎟⎟
⎝⎝ ⎝x₀₀⎠ ⎠⎠
Best of epoch at R=1.000000
-> Raw expression :
-c₀₀
──────────────── + c₀₀⋅x₀₁⋅x₀₁
⎛ 1 ⎞
⎜──────────────⎟
⎜⎛ 1.0 ⎞⎟
⎜⎜- -c₀₁⋅ℯ ⎟⎟
⎜⎜────────────⎟⎟
⎜⎜ ⎛ 1 ⎞ ⎟⎟
⎜⎜ ⎜───⎟ ⎟⎟
⎝⎝ ⎝x₀₀⎠ ⎠⎠
/rds/project/jmmh2/rds-jmmh2-projects/olink_proteomics/scallop/PhySO/physo/learn/monitoring.py:640: UserWarning: Creating legend with loc="best" can be slow with large amounts of data. self.fig.savefig(self.save_path)
SR task started...
100%|██████████| 1000/1000 [00:00<00:00, 30244.04it/s] 100%|██████████| 1000/1000 [00:00<00:00, 105469.32it/s]
=========== Epoch 00000 ===========
-> Time 26.15 s
Overall best at R=0.577732
-> Raw expression :
z
───────────────────────────────
2
⎛ ⎛ 2⎞ ⎞
⎜ 0.5⎜⎛ 1.0⎞ ⎟ ⎟
⎜- sin ⎝⎝ℯ ⎠ ⎠ - sin(1.0)⎟
⎜────────────────────────────⎟
⎜ 0.5 ⎟
⎜ ⎛ g ⎞ ⎟
⎜ ⎜───⎟ ⎟
⎜ ⎜⎛1⎞⎟ ⎟
⎜ ⎜⎜─⎟⎟ ⎟
⎝ ⎝⎝m⎠⎠ ⎠
Best of epoch at R=0.577732
-> Raw expression :
z
───────────────────────────────
2
⎛ ⎛ 2⎞ ⎞
⎜ 0.5⎜⎛ 1.0⎞ ⎟ ⎟
⎜- sin ⎝⎝ℯ ⎠ ⎠ - sin(1.0)⎟
⎜────────────────────────────⎟
⎜ 0.5 ⎟
⎜ ⎛ g ⎞ ⎟
⎜ ⎜───⎟ ⎟
⎜ ⎜⎛1⎞⎟ ⎟
⎜ ⎜⎜─⎟⎟ ⎟
⎝ ⎝⎝m⎠⎠ ⎠
100%|██████████| 1000/1000 [00:00<00:00, 4509.68it/s] 100%|██████████| 1000/1000 [00:00<00:00, 55723.45it/s]
=========== Epoch 00001 ===========
-> Time 18.95 s
Overall best at R=0.577732
-> Raw expression :
z
───────────────────────────────
2
⎛ ⎛ 2⎞ ⎞
⎜ 0.5⎜⎛ 1.0⎞ ⎟ ⎟
⎜- sin ⎝⎝ℯ ⎠ ⎠ - sin(1.0)⎟
⎜────────────────────────────⎟
⎜ 0.5 ⎟
⎜ ⎛ g ⎞ ⎟
⎜ ⎜───⎟ ⎟
⎜ ⎜⎛1⎞⎟ ⎟
⎜ ⎜⎜─⎟⎟ ⎟
⎝ ⎝⎝m⎠⎠ ⎠
Best of epoch at R=0.577732
-> Raw expression :
1
─────────────────────────────────────
⎛ ⎛ 0.5 ⎞⎞
⎜ ⎜ 0.5⎛ 2⎞ 1.0⎟⎟
⎜ cos⎜- log ⎝1.0 ⎠ + 1.0 + ───⎟⎟
⎜ ⎝ 1.0⎠⎟
⎜ℯ ⎟
⎜───────────────────────────────────⎟
⎝ g⋅m⋅z ⎠
100%|██████████| 1000/1000 [00:00<00:00, 9229.29it/s] 100%|██████████| 1000/1000 [00:00<00:00, 59802.44it/s]
=========== Epoch 00002 ===========
-> Time 33.70 s
Overall best at R=0.577732
-> Raw expression :
z
───────────────────────────────
2
⎛ ⎛ 2⎞ ⎞
⎜ 0.5⎜⎛ 1.0⎞ ⎟ ⎟
⎜- sin ⎝⎝ℯ ⎠ ⎠ - sin(1.0)⎟
⎜────────────────────────────⎟
⎜ 0.5 ⎟
⎜ ⎛ g ⎞ ⎟
⎜ ⎜───⎟ ⎟
⎜ ⎜⎛1⎞⎟ ⎟
⎜ ⎜⎜─⎟⎟ ⎟
⎝ ⎝⎝m⎠⎠ ⎠
Best of epoch at R=0.537882
-> Raw expression :
2
⎛ m ⎞
⎜───────────────────────⎟
⎜ 0.5⎟
⎜⎛ 1 ⎞ ⎟
⎜⎜ ───────────────⎟ ⎟
⎜⎜ 0.5 ⎛ 1 ⎞⎟ ⎟
⎜⎜ 1.0 ⋅log⎜───⎟⎟ ⎟
⎜⎜ ⎝1.0⎠⎟ ⎟
⎜⎜m⋅ℯ ⎟ ⎟
⎜⎜──────────────────⎟ ⎟
⎝⎝ v⋅v ⎠ ⎠
100%|██████████| 1000/1000 [00:00<00:00, 6153.97it/s] 100%|██████████| 1000/1000 [00:00<00:00, 93281.38it/s]
=========== Epoch 00003 ===========
-> Time 5.95 s
Overall best at R=0.577732
-> Raw expression :
z
───────────────────────────────
2
⎛ ⎛ 2⎞ ⎞
⎜ 0.5⎜⎛ 1.0⎞ ⎟ ⎟
⎜- sin ⎝⎝ℯ ⎠ ⎠ - sin(1.0)⎟
⎜────────────────────────────⎟
⎜ 0.5 ⎟
⎜ ⎛ g ⎞ ⎟
⎜ ⎜───⎟ ⎟
⎜ ⎜⎛1⎞⎟ ⎟
⎜ ⎜⎜─⎟⎟ ⎟
⎝ ⎝⎝m⎠⎠ ⎠
Best of epoch at R=0.537882
-> Raw expression :
1 1
m⋅1.0⋅─────────────────────────────⋅────
⎛ 1 ⎞ ⎛1 ⎞
⎜───────────────────────────⎟ ⎜──⎟
⎜ ⎛ 2 ⎞⎟ ⎜ 2⎟
⎜ ⎜⎛ 1 z⎞ ⎟⎟ ⎝v ⎠
⎜cos⎜⎜─── + ─⎟ - 1.0 + 1.0⎟⎟
⎝ ⎝⎝1.0 z⎠ ⎠⎠
100%|██████████| 1000/1000 [00:00<00:00, 9579.75it/s] 100%|██████████| 1000/1000 [00:00<00:00, 96049.83it/s]
=========== Epoch 00004 ===========
-> Time 6.73 s
Overall best at R=0.577732
-> Raw expression :
z
───────────────────────────────
2
⎛ ⎛ 2⎞ ⎞
⎜ 0.5⎜⎛ 1.0⎞ ⎟ ⎟
⎜- sin ⎝⎝ℯ ⎠ ⎠ - sin(1.0)⎟
⎜────────────────────────────⎟
⎜ 0.5 ⎟
⎜ ⎛ g ⎞ ⎟
⎜ ⎜───⎟ ⎟
⎜ ⎜⎛1⎞⎟ ⎟
⎜ ⎜⎜─⎟⎟ ⎟
⎝ ⎝⎝m⎠⎠ ⎠
Best of epoch at R=0.577732
-> Raw expression :
m⋅z
───────────────────────────
⎛ ⎛ ⎛ 2⎞⎞ ⎞
⎜ ⎜ ⎜⎛ 1⎞ ⎟⎟ ⎟
⎜ ⎜ ⎜⎜m⋅1.0⋅─⎟ ⎟⎟ ⎟
⎜ ⎜ ⎝⎝ m⎠ ⎠⎟ ⎟
⎜log⎝-ℯ ⎠ + 1.0⎟
⎜─────────────────────────⎟
⎝ g ⎠
100%|██████████| 1000/1000 [00:00<00:00, 10614.14it/s] 100%|██████████| 1000/1000 [00:00<00:00, 84402.62it/s]
=========== Epoch 00005 ===========
-> Time 6.19 s
Overall best at R=0.577732
-> Raw expression :
z
───────────────────────────────
2
⎛ ⎛ 2⎞ ⎞
⎜ 0.5⎜⎛ 1.0⎞ ⎟ ⎟
⎜- sin ⎝⎝ℯ ⎠ ⎠ - sin(1.0)⎟
⎜────────────────────────────⎟
⎜ 0.5 ⎟
⎜ ⎛ g ⎞ ⎟
⎜ ⎜───⎟ ⎟
⎜ ⎜⎛1⎞⎟ ⎟
⎜ ⎜⎜─⎟⎟ ⎟
⎝ ⎝⎝m⎠⎠ ⎠
Best of epoch at R=0.577732
-> Raw expression :
cos(1.0)
──────────────────
⎛ -1 ⎞
⎜────────────────⎟
⎝m⋅1.0⋅z⋅(-g - g)⎠
100%|██████████| 1000/1000 [00:01<00:00, 829.43it/s] 100%|██████████| 1000/1000 [00:00<00:00, 54925.15it/s]
=========== Epoch 00006 ===========
-> Time 8.09 s
Overall best at R=0.577732
-> Raw expression :
z
───────────────────────────────
2
⎛ ⎛ 2⎞ ⎞
⎜ 0.5⎜⎛ 1.0⎞ ⎟ ⎟
⎜- sin ⎝⎝ℯ ⎠ ⎠ - sin(1.0)⎟
⎜────────────────────────────⎟
⎜ 0.5 ⎟
⎜ ⎛ g ⎞ ⎟
⎜ ⎜───⎟ ⎟
⎜ ⎜⎛1⎞⎟ ⎟
⎜ ⎜⎜─⎟⎟ ⎟
⎝ ⎝⎝m⎠⎠ ⎠
Best of epoch at R=0.577732
-> Raw expression :
m
───────────────────
⎛ 0.5⎞
⎜(cos(1.0)⋅1.0) ⎟
⎜─────────────────⎟
⎝ g⋅z ⎠
100%|██████████| 1000/1000 [00:01<00:00, 675.71it/s] 100%|██████████| 1000/1000 [00:00<00:00, 87194.23it/s]
=========== Epoch 00007 ===========
-> Time 6.62 s
Overall best at R=0.577732
-> Raw expression :
z
───────────────────────────────
2
⎛ ⎛ 2⎞ ⎞
⎜ 0.5⎜⎛ 1.0⎞ ⎟ ⎟
⎜- sin ⎝⎝ℯ ⎠ ⎠ - sin(1.0)⎟
⎜────────────────────────────⎟
⎜ 0.5 ⎟
⎜ ⎛ g ⎞ ⎟
⎜ ⎜───⎟ ⎟
⎜ ⎜⎛1⎞⎟ ⎟
⎜ ⎜⎜─⎟⎟ ⎟
⎝ ⎝⎝m⎠⎠ ⎠
Best of epoch at R=0.537882
-> Raw expression :
2
⎛ ⎛ 2⎞⎞
⎜ ⎜⎛ 1 ⎞ ⎟⎟
⎜ ⎜⎜ ────────────────⎟ ⎟⎟
⎜ ⎜⎜ ⎛ 0.5⎞⎟ ⎟⎟
⎜ ⎜⎜ ⎜⎛ 0.5⎞ ⎟⎟ ⎟⎟
⎜ ⎜⎜ log⎝⎝1.0 ⎠ ⎠⎟ ⎟⎟
⎜ ⎜⎝ℯ ⎠ ⎟⎟
m⋅⎜v⋅sin⎜────────────────────⎟⎟
⎝ ⎝ 1.0 ⎠⎠
100%|██████████| 1000/1000 [00:00<00:00, 1240.52it/s] 100%|██████████| 1000/1000 [00:00<00:00, 69966.87it/s]
=========== Epoch 00008 ===========
-> Time 5.05 s
Overall best at R=0.577732
-> Raw expression :
z
───────────────────────────────
2
⎛ ⎛ 2⎞ ⎞
⎜ 0.5⎜⎛ 1.0⎞ ⎟ ⎟
⎜- sin ⎝⎝ℯ ⎠ ⎠ - sin(1.0)⎟
⎜────────────────────────────⎟
⎜ 0.5 ⎟
⎜ ⎛ g ⎞ ⎟
⎜ ⎜───⎟ ⎟
⎜ ⎜⎛1⎞⎟ ⎟
⎜ ⎜⎜─⎟⎟ ⎟
⎝ ⎝⎝m⎠⎠ ⎠
Best of epoch at R=0.577732
-> Raw expression :
1
──────────────────────────────────────
⎛ m ⎞
⎜────────────────────────────────────⎟
⎜ ⎛ 1 ⎞⎟
⎜g⋅z⋅m⋅m⋅log⎜-1.0 + ────────────────⎟⎟
⎜ ⎜ ⎛ cos(1.0) ⎞⎟⎟
⎜ ⎜ ⎜──────────────⎟⎟⎟
⎝ ⎝ ⎝cos(1.0) + 1.0⎠⎠⎠
100%|██████████| 1000/1000 [00:00<00:00, 1515.36it/s] 100%|██████████| 1000/1000 [00:00<00:00, 73700.65it/s]
=========== Epoch 00009 ===========
-> Time 4.81 s
Overall best at R=0.577732
-> Raw expression :
z
───────────────────────────────
2
⎛ ⎛ 2⎞ ⎞
⎜ 0.5⎜⎛ 1.0⎞ ⎟ ⎟
⎜- sin ⎝⎝ℯ ⎠ ⎠ - sin(1.0)⎟
⎜────────────────────────────⎟
⎜ 0.5 ⎟
⎜ ⎛ g ⎞ ⎟
⎜ ⎜───⎟ ⎟
⎜ ⎜⎛1⎞⎟ ⎟
⎜ ⎜⎜─⎟⎟ ⎟
⎝ ⎝⎝m⎠⎠ ⎠
Best of epoch at R=0.577732
-> Raw expression :
⎛ 0.5⎞
⎜⎛ 1 ⎞ ⎟
⎜⎜──────⎟ ⎟
⎜⎜ ⎛m⎞⎟ ⎟
⎜⎜cos⎜─⎟⎟ ⎟
⎝⎝ ⎝m⎠⎠ ⎠
m⋅z⋅ℯ
──────────────────
⎛1⎞
⎜─⎟
⎝g⎠
100%|██████████| 1000/1000 [00:01<00:00, 854.17it/s] 100%|██████████| 1000/1000 [00:00<00:00, 70824.61it/s]
=========== Epoch 00010 ===========
-> Time 5.97 s
Overall best at R=0.577732
-> Raw expression :
z
───────────────────────────────
2
⎛ ⎛ 2⎞ ⎞
⎜ 0.5⎜⎛ 1.0⎞ ⎟ ⎟
⎜- sin ⎝⎝ℯ ⎠ ⎠ - sin(1.0)⎟
⎜────────────────────────────⎟
⎜ 0.5 ⎟
⎜ ⎛ g ⎞ ⎟
⎜ ⎜───⎟ ⎟
⎜ ⎜⎛1⎞⎟ ⎟
⎜ ⎜⎜─⎟⎟ ⎟
⎝ ⎝⎝m⎠⎠ ⎠
Best of epoch at R=0.577732
-> Raw expression :
1
──────────────────────────────
⎛ ⎛ 2⎞⎞
⎜ ⎜⎛ ⎛ m ⎞ ⎞ ⎟⎟
⎜ ⎜⎜ ⎜ ─────⎟ ⎟ ⎟⎟
⎜ ⎜⎜ ⎜ 1 ⎟ ⎟ ⎟⎟
⎜ ⎜⎜ ⎜ m⋅───⎟ ⎟ ⎟⎟
⎜ ⎜⎜ 0.5⎜ 1.0⎟ ⎟ ⎟⎟
⎜log⎝⎝sin ⎝ℯ ⎠ + 1.0⎠ ⎠⎟
⎜────────────────────────────⎟
⎜ ⎛m⋅z⎞ ⎟
⎜ ⎜───⎟ ⎟
⎜ ⎜⎛1⎞⎟ ⎟
⎜ ⎜⎜─⎟⎟ ⎟
⎝ ⎝⎝g⎠⎠ ⎠
100%|██████████| 1000/1000 [00:01<00:00, 946.04it/s] 100%|██████████| 1000/1000 [00:00<00:00, 55083.84it/s]
=========== Epoch 00011 ===========
-> Time 7.00 s
Overall best at R=1.000000
-> Raw expression :
m
g⋅m⋅z + ─────────────────
2
⎛ ⎛m⋅v⎞ ⎞
⎜cos⎜───⎟ - 1.0⎟
⎜ ⎝m⋅v⎠ ⎟
⎜──────────────⎟
⎝ v ⎠
Best of epoch at R=1.000000
-> Raw expression :
m
g⋅m⋅z + ─────────────────
2
⎛ ⎛m⋅v⎞ ⎞
⎜cos⎜───⎟ - 1.0⎟
⎜ ⎝m⋅v⎠ ⎟
⎜──────────────⎟
⎝ v ⎠
100%|██████████| 1000/1000 [00:02<00:00, 499.07it/s] 100%|██████████| 1000/1000 [00:00<00:00, 50091.41it/s]
=========== Epoch 00012 ===========
-> Time 7.31 s
Overall best at R=1.000000
-> Raw expression :
m
g⋅m⋅z + ─────────────────
2
⎛ ⎛m⋅v⎞ ⎞
⎜cos⎜───⎟ - 1.0⎟
⎜ ⎝m⋅v⎠ ⎟
⎜──────────────⎟
⎝ v ⎠
Best of epoch at R=0.577732
-> Raw expression :
z
────────
⎛ -1 ⎞
⎜ ───⋅m⎟
⎜ m ⎟
⎜ℯ ⎟
⎜──────⎟
⎝ g⋅m ⎠
100%|██████████| 1000/1000 [00:01<00:00, 705.77it/s] 100%|██████████| 1000/1000 [00:00<00:00, 34759.33it/s]
=========== Epoch 00013 ===========
-> Time 7.62 s
Overall best at R=1.000000
-> Raw expression :
m
g⋅m⋅z + ─────────────────
2
⎛ ⎛m⋅v⎞ ⎞
⎜cos⎜───⎟ - 1.0⎟
⎜ ⎝m⋅v⎠ ⎟
⎜──────────────⎟
⎝ v ⎠
Best of epoch at R=0.577732
-> Raw expression :
g
───────────
⎛ m ⎞
⎜─────────⎟
⎜⎛m⋅m⋅v⋅z⎞⎟
⎜⎜───────⎟⎟
⎝⎝ v ⎠⎠
100%|██████████| 1000/1000 [00:03<00:00, 312.39it/s] 100%|██████████| 1000/1000 [00:00<00:00, 30203.31it/s]
=========== Epoch 00014 ===========
-> Time 8.43 s
Overall best at R=1.000000
-> Raw expression :
m
g⋅m⋅z + ─────────────────
2
⎛ ⎛m⋅v⎞ ⎞
⎜cos⎜───⎟ - 1.0⎟
⎜ ⎝m⋅v⎠ ⎟
⎜──────────────⎟
⎝ v ⎠
Best of epoch at R=0.577732
-> Raw expression :
⎛ 1 ⎞
g⋅m⋅z⋅cos⎜─────⎟
⎜-1 ⎟
⎜───⋅v⎟
⎝ v ⎠
100%|██████████| 1000/1000 [00:03<00:00, 308.55it/s] 100%|██████████| 1000/1000 [00:00<00:00, 27848.96it/s]
=========== Epoch 00015 ===========
-> Time 7.48 s
Overall best at R=1.000000
-> Raw expression :
m
g⋅m⋅z + ─────────────────
2
⎛ ⎛m⋅v⎞ ⎞
⎜cos⎜───⎟ - 1.0⎟
⎜ ⎝m⋅v⎠ ⎟
⎜──────────────⎟
⎝ v ⎠
Best of epoch at R=0.577732
-> Raw expression :
g⋅z
───────────────
⎛ 2 -sin(1.0) ⎞
⎜m ⋅──────────⎟
⎜ m ⎟
⎜─────────────⎟
⎜ 2 ⎟
⎝ m ⎠
100%|██████████| 1000/1000 [00:04<00:00, 225.69it/s] 100%|██████████| 1000/1000 [00:00<00:00, 22721.04it/s]
=========== Epoch 00016 ===========
-> Time 8.60 s
Overall best at R=1.000000
-> Raw expression :
m
g⋅m⋅z + ─────────────────
2
⎛ ⎛m⋅v⎞ ⎞
⎜cos⎜───⎟ - 1.0⎟
⎜ ⎝m⋅v⎠ ⎟
⎜──────────────⎟
⎝ v ⎠
Best of epoch at R=0.577732
-> Raw expression :
⎛ ⎛-1 ⎞ ⎞
⎜ ⎜───⎟ ⎟
⎜ ⎝ m ⎠ ⎟
-g⋅m⋅z⋅sin⎜─────────⎟
⎜⎛ 1.0 ⎞⎟
⎜⎜───────⎟⎟
⎜⎜⎛ 1 ⎞⎟⎟
⎜⎜⎜─────⎟⎟⎟
⎜⎜⎜1 ⎟⎟⎟
⎜⎜⎜─⋅1.0⎟⎟⎟
⎝⎝⎝m ⎠⎠⎠
/usr/local/Cluster-Apps/ceuadmin/PhySO/lib/python3.8/site-packages/IPython/core/pylabtools.py:152: UserWarning: Creating legend with loc="best" can be slow with large amounts of data. fig.canvas.print_figure(bytes_io, **kw)
print(expression.get_infix_pretty(do_simplify=True))
print(expression.get_infix_latex(do_simplify=True))
print(expression.free_const_values.cpu().detach().numpy())
pareto_front_complexities, pareto_front_expressions, pareto_front_r, pareto_front_rmse = logs.get_pareto_front()
for i, prog in enumerate(pareto_front_expressions):
# Showing expression
print(prog.get_infix_pretty(do_simplify=True))
# Showing free constant
free_consts = prog.free_const_values.detach().cpu().numpy()
for j in range (len(free_consts)):
print("%s = %f"%(prog.library.free_const_names[j], free_consts[j]))
# Showing RMSE
print("RMSE = {:e}".format(pareto_front_rmse[i]))
print("-------------")
2
m⋅v
g⋅m⋅z + ──────────────
2
(-1 + cos(1))
g m z + \frac{m v^{2}}{\left(-1 + \cos{\left(1 \right)}\right)^{2}}
[46.40785791 0.26077131]
2
m⋅v
g = 1.000000
m = 1.253876
RMSE = 6.915446e+01
-------------
136044688160947⋅g⋅m⋅z
─────────────────────
100000000000000
g = 2.999864
m = 2.999864
RMSE = 5.883228e+01
-------------
2
m⋅v
g⋅m⋅z + ──────────────
2
(-1 + cos(1))
g = 46.407858
m = 0.260771
RMSE = 1.384834e-06
-------------
2
m⋅v
g⋅m⋅z + ──────────────
2
(-1 + cos(1))
g = 46.407858
m = 0.260771
RMSE = 1.384834e-06
-------------